//
//  YJMJGifHeaer.m
//  com.yjwh.yj
//
//  Created by ferver7 on 2018/10/9.
//  Copyright © 2018年 ferver7. All rights reserved.
//

#import "YJMJGifHeaer.h"

@implementation YJMJGifHeaer

#pragma mark - 重写方法
#pragma mark 基本设置
- (void)prepare
{
    [super prepare];
    
    // 设置普通状态的动画图片
    NSMutableArray *idleImages = [NSMutableArray array];
    for (NSUInteger i = 1; i<=8; i++) {
        UIImage *image = [UIImage imageNamed:[NSString stringWithFormat:@"load%zd", i]];
        [idleImages addObject:image];
    }
    [self setImages:idleImages duration:0.3 forState:MJRefreshStateIdle];
    
    // 设置即将刷新状态的动画图片（一松开就会刷新的状态）
    NSMutableArray *refreshingImages = [NSMutableArray array];
    for (NSUInteger i = 1; i<=8; i++) {
        UIImage *image = [UIImage imageNamed:[NSString stringWithFormat:@"load%zd", i]];
        [refreshingImages addObject:image];
    }
    [self setImages:refreshingImages duration:0.3 forState:MJRefreshStatePulling];
    
    // 设置正在刷新状态的动画图片
    [self setImages:refreshingImages forState:MJRefreshStateRefreshing];
    
    self.lastUpdatedTimeLabel.hidden = YES;
}

@end
